﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RouterControl.Web;
using RouterControl.Whs;

namespace RouterControl.WhsAddIn.Wizards.SelectRouter.FeatureTests
{
    internal sealed class FeatureTestConnectionSpeed : FeatureTest
    {
        public FeatureTestConnectionSpeed(CommonInternetGateway dev, UsageInfo.RouterInfo info)
            : base(dev, info, "Connection Speed")
        {
        }

        public override DiagResult Run()
        {
            var supported = (
                _dev.DownloadMaxBitRate.HasValue &&
                _dev.UploadMaxBitRate.HasValue
                );

            _info.SupportsConnectionSpeed = supported;

            return (
                supported ?
                DiagResult.Success :
                DiagResult.Failure
                );
        }
    }
}